class_name FlyMagicStateMagic
extends StateBase


var unit: UnitFlyMagic


func on_enter(owner = null, params = null):
	unit = owner as UnitFlyMagic
	unit.animation_player.play("magic")
	
	await get_tree().create_timer(0.3).timeout
	unit.level.emit_particle("particle_shoot_ice_magic", unit.ice_shoot_magic_marker.global_position)
	
	await unit.animation_player.animation_finished
	unit.shoot_magic()
	unit.states.transition("Approach")
	

func on_exit(owner = null):
	pass


func on_process(delta: float, owner = null):
	pass
	
	
func on_physics_process(delta: float, owner = null):
	pass
	
